/**
 * 
 */
package com.dalonedrow.module.hq.bus.heroes;

import com.dalonedrow.engine.sprite.base.SpriteImageObjectFactory;
import com.dalonedrow.globalvariables.constants.hq.GlobalConstants;
import com.dalonedrow.module.hq.bus.item.weapons.Broadsword;
import com.dalonedrow.module.hq.bus.item.weapons.Dagger;
import com.dalonedrow.module.hq.bus.item.weapons.Shortsword;
import com.dalonedrow.module.hq.rpg.HQCharacter;
import com.dalonedrow.module.hq.rpg.HQInteractiveObject;
import com.dalonedrow.module.hq.systems.HQEquipment;
import com.dalonedrow.module.hq.systems.HQInventory;
import com.dalonedrow.module.hq.systems.HQPlayer;
import com.dalonedrow.rpg.base.flyweights.Scriptable;

/**
 * @author Donald
 */
public final class Strom extends Scriptable<HQInteractiveObject> {
	/**
	 * {@inheritDoc}
	 */
	@Override
	public int onInit() throws Exception {
		super.getIO().addIOFlag(GlobalConstants.IO_01_PC);
		HQCharacter pc = super.getIO().getPCData();
		pc.setName("Strom");
		pc.setProfession(GlobalConstants.CLASS_01DWARF);
		pc.setMagician(false);
		pc.setSpriteRef(
				SpriteImageObjectFactory.getInstance().getImageRefId(
						"ultima_dwarf_strom"));
		pc.setBaseAttack(0);
		pc.setBaseDefend(2);
		pc.setBaseBody(GlobalConstants.INT_007);
		pc.setBaseMaxBody(GlobalConstants.INT_007);
		pc.setBaseMind(GlobalConstants.INT_003);
		pc.setBaseMaxMind(GlobalConstants.INT_003);
		pc.setBaseMovement(2);
		HQInteractiveObject shortsword =
				HQEquipment.getInstance().getFreshItem(new Shortsword());
		HQEquipment.getInstance().equipItem(super.getIO(), shortsword);
		if (!HQInventory.getInstance().canBePutInInventory(
				shortsword, super.getIO())) {
			throw new Exception("COULD NOT EQUIP SHORTSWORD");
		}
		HQPlayer.getInstance().computePlayerFullStats(super.getIO());
		return super.onInit();
	}
}
